'use strict';
const dayjs = require("dayjs");
const {getDefaultModelConfig} = require("../../utils/common");

module.exports = app => {
    const { STRING, INTEGER, TINYINT, TEXT } = app.Sequelize;
    return app.model.define(
        'TravelCategory',
        {
            id: {type: INTEGER, primaryKey: true, autoIncrement: true},
            name: {type: STRING(255), allowNull: false, comment: '旅行分类名称'},
            cover: {type: STRING(500), comment: '旅行分类封面图片'},
            description: {type: TEXT, comment: '旅行分类详情'},
            sort: {type: INTEGER, defaultValue: 0, comment: '排序'},
            status: {type: TINYINT, defaultValue: 1, comment: '状态：1-上架，0-下架'},
            transportation_flag: {type: TINYINT, defaultValue: 0, comment: '交通标志：1-包含交通，0-不包含'},
            destination_group_flag: {type: TINYINT, defaultValue: 0, comment: '目的地团标志：1-是目的地团，0-不是'},
            ...getDefaultModelConfig(app)
        },
        {
            tableName: 'travel_category',
            timestamps: true,
            createdAt: 'create_time',
            updatedAt: 'update_time'
        }
    );
}; 